package modele.WorldElem;

import java.awt.Color;

import modele.Square;
import modele.World;

import controller.Rule;
import controller.Visitor;

public class WaterSource extends State{
	
	public WaterSource(){
		Flooded ss = new Flooded();
		ss.setWaterLevel(6);
		this.setSecondaryState(ss);
		
	}
	
	public WaterSource(SecondaryState ss){
		super(ss);
	}
	
	

	@Override
	public int getState() {
		return State.WATERSOURCE;
	}

	@Override
	public void evolve(Square s, World w) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void accept(Visitor v) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void applyRule(Rule r, Square s, World w) {
		r.applyRule(this, s);
	}

	@Override
	public int getStateAdditionalAltitude() {
		return 0;
	}

	@Override
	public Color getColor(Square s) {
		if(this.getSecondaryStateValue()!= SecondaryState.NONE) return this.getSecondaryState().getColor(s);
		return new Color(105,(int)(105+s.getAltitude())/2,105);
	}

	@Override
	public Object clone() {
		return new WaterSource((SecondaryState) getSecondaryState().clone());
	}

}
